<template>
  <div class="restaurant-details">
    <el-card>
      <img :src="restaurant.image" alt="" class="restaurant-image">
      <h2>{{ restaurant.name }}</h2>
      <el-rate v-model="restaurant.rating" disabled></el-rate>
    </el-card>
    <div class="dishes-list">
      <el-card class="dish-card" v-for="dish in restaurant.dishes" :key="dish.id">
        <img :src="dish.image" alt="" class="dish-image">
        <div class="dish-info">
          <h3>{{ dish.name }}</h3>
          <p>￥{{ dish.price }}</p>
        </div>
      </el-card>
    </div>
    <div class="reviews">
      <el-card>
        <h3>用户评价</h3>
        <!-- 用户评价列表 -->
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      restaurant: {
        // 假设的数据
        id: 1,
        name: '餐厅A',
        image: require('@/assets/img.png'),
        rating: 4.5,
        dishes: [
          { id: 1, name: '菜品1', image: require('@/assets/img_1.png'), price: 20 },
          // 更多菜品...
        ]
      }
    };
  }
};
</script>

<style>
.restaurant-details {
  padding: 20px;
}
.restaurant-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
}
.dishes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dish-card {
  width: calc(25% - 10px);
}
.dish-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
}
.dish-info {
  padding: 10px;
}
</style>
